package homeword;

public class ID_card_String {
    public static void main(String[] args) {
        String id = "450722200511245613";
        String year = id.substring(6, 10);
        String month=id.substring(10,12);
        String day=id.substring(12,14);
        System.out.println("身份信息");
        //因为要转换为数字进行求奇偶所以采取charAt方法，返回char类型
        char gander=id.charAt(16);
        if(gander-'0'%2==0){
            System.out.println("性别：女");
        }
        else{
            System.out.println("性别：男");
        }
        System.out.println("出生年月日："+year+"年"+month+"月"+day+"日");


    }
}
